import {Component, Input, OnInit} from '@angular/core';
import {DhlCommonInputComponent} from '../dhlCommonInput';

@Component({
  selector: 'dhl-radio',
  templateUrl: './dhl-radio.component.html'
})
export class DhlRadioComponent extends DhlCommonInputComponent implements OnInit {

  @Input() spaceWidth = 10;
  @Input() options = [];

  @Input() set dicCode(value) {
    this.options = this.cacheService.getOptions(value);
  }


  constructor() {
    super();
  }


  ngOnInit() {
    this.inputWidth = this.labelWidth < 24 ? 24 - this.labelWidth : 1;
  }

  modelChange() {
    this.valueChange.emit(this.value);
  }

  afterInitValue() {
    // @ts-ignore
    this.inputValue = this.inputValue + '';
  }

}

